<CFSET appname = GetForm.DESCRIPTION & " [View Details]">
	<!--- get records for the eform to view --->
	<CFIF ParameterExists(url.view)>
		<CFQUERY NAME="GetEntry" DATASOURCE="#table_dsn#" MAXROWS=1>
			SELECT *
			FROM #GetForm.TABLENAME_FK#
			WHERE
				(PERSONNELIDNO = '#GetEmployee.PERSONNELIDNO#')
				<CFLOOP  INDEX="x" FROM="1" TO="5">
					<CFIF evaluate("GetForm.PK_FIELD" & x) NEQ "">
						<CFSET theVal = evaluate("url." & evaluate("GetForm.PK_FIELD" & x))>
						AND (#ucase(evaluate("GetForm.PK_FIELD" & x))# = '#theVal#')
					</CFIF>
				</CFLOOP>
		</CFQUERY>

		<CFIF NOT(GetEntry.RecordCount)>
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="#appname#">
			<BR><BR><B>Unauthorized access detected!</B><BR><BR>
			Please use the standard editor to avoid
			being reported for illegal use of the software.
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
			<CFABORT>
		</CFIF>

		<!--- routing --->
		<CFINCLUDE TEMPLATE="_dataflow.cfm">
		<!--- Added by Maan 09262007, to display process message on view --->
		<CFIF Trim(GetForm.PREPROCESSPROMPT) NEQ "" OR Trim(GetForm.PREPROMPTMPLATE) NEQ "">
			<CFIF Trim(GetForm.PREPROMPTTITLE) IS "">
				<CFSET sPreProcessTitle="Pre-process Prompt">
			<CFELSE>
				<CFSET sPreProcessTitle=GetForm.PREPROMPTTITLE>
			</CFIF>
			<CFIF FileExists("#GetDirectoryFromPath(GetCurrentTemplatePath())#..\pre_activities\#GetForm.PREPROMPTMPLATE#")>
				<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="#sPreProcessTitle#">
					<table cellpadding="0" cellspacing="0" border="0" width="100%">
						<tr>
							<td><CFOUTPUT>#GetForm.PREPROCESSPROMPT#</CFOUTPUT></td>
						</tr>
					
						<tr>
							<td><CFINCLUDE TEMPLATE="..\pre_activities\#GetForm.PREPROMPTMPLATE#"></td>
						</tr>
					</table>
				<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
			</CFIF>
		</CFIF>
		<CFIF GetForm.PREUP2RCPTLEVEL IS "Y" AND Trim(GetForm.PREPROCESS) NEQ "">
			<CFIF Trim(GetForm.PREPROCESSTITLE) IS "">
				<CFSET sPreProcessTitle="Pre-approval Activity">
			<CFELSE>
				<CFSET sPreProcessTitle=GetForm.PREPROCESSTITLE>
			</CFIF>

			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="#sPreProcessTitle#">
			<table cellpadding="0" cellspacing="0" border="0" width="100%">
			<tr>
				<td>
				<!--- Check if template is existing --->
				<CFIF FileExists("#GetDirectoryFromPath(GetCurrentTemplatePath())#..\pre_activities\#GetForm.PREPROCESS#")>
					<CFSET lPreProcessValidated="No">
					<CFSET lPreProcessShowMsg = "Yes">
					<CFINCLUDE TEMPLATE="..\pre_activities\#GetForm.PREPROCESS#">
				<CFELSE>
					<CFOUTPUT>
					Pre-process template for #sPreProcessTitle# is missing.<br>
					Please contact your iBOS/e Administrator.
					</CFOUTPUT>
				</CFIF>
				</td>
			</tr>
			</table>
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
		</CFIF>
		<!--- END HERE --->
		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="#appname#">

		<CFOUTPUT>
		<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 BGCOLOR="#client.color_tblhead#" WIDTH="100%">
			<FORM ACTION="#eform.sender#" METHOD="post" NAME="eForm">
			<TR>
				<TD>
					<INPUT TYPE="submit" NAME="Cancel" VALUE="Back" CLASS="bitbtn">
					<input type="hidden" name="hdpid" value="#GetEntry.PERSONNELIDNO#" />
				</TD>
			</TR>
			</FORM>
		</TABLE>
		</CFOUTPUT>

		<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH="100%">
			<CFOUTPUT>
			<TR>
				<TD ALIGN="right"><IMG SRC="#client.image_path##session.site_ibose#"></TD>
				<TD NOWRAP CLASS="bold14" WIDTH="100%"><FONT FACE="Impact" SIZE="+2">#client.companyname#</FONT><BR>#GetForm.DESCRIPTION#</TD>
			</TR>
			</CFOUTPUT>
		</TABLE>

		<!--- get attachments --->
		<CFINCLUDE TEMPLATE="..\common\_getattachments.cfm">

		<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=2 WIDTH="100%" BGCOLOR="#FFFFFF">
		<CFOUTPUT QUERY="GetFields" GROUP="FIELDGROUP">
			<CFIF len(trim(FIELDGROUP)) NEQ 0>
			<TR>
				<TD CLASS="bold11" BGCOLOR="#client.color_tblset2#" COLSPAN=2>
					&nbsp;#FIELDGROUP# <!---#HINT#--->
				</TD>
			</TR>
			</CFIF>

			<CFOUTPUT>
			<!--- get the value of the entry --->
			<CFPARAM NAME="Form.edt#COLUMNNAME#" DEFAULT="">
			<CFSET sEntryValue = #evaluate("GetEntry." & COLUMNNAME)#>
			<CFIF NOT IsSimpleValue(sEntryValue)>
				<CFSET sEntryValue = "interface not supported.">
			</CFIF>

			<!--- skip null values --->
			<CFIF len(trim(sEntryValue)) NEQ 0>

				<TR VALIGN="top">
					<TD VALIGN="top" ALIGN="right">&nbsp;&nbsp;#COLUMNDESC#:&nbsp;</TD>
					<TD VALIGN="top" WIDTH="100%" HEIGHT=18 nowrap>&nbsp;<B>
					<!--- For extra desc in lookup --->
					<CFSET lWithExtra=false>

					<!--- check on what form control to use --->
					<CFSWITCH EXPRESSION="#lcase(COLUMNTYPE)#">
						<!--- calculator lookup --->
						<CFCASE VALUE="ftinteger">
							#sEntryValue#
						</CFCASE>

						<!--- calculator lookup --->
						<CFCASE VALUE="ftfloat">
							#sEntryValue#
						</CFCASE>
						<CFCASE VALUE="ftcombo">
							#sEntryValue#
						</CFCASE>
						<CFCASE VALUE="ftsmallint">
							#sEntryValue#
						</CFCASE>
						<CFCASE VALUE="ftcurrency">
							#sEntryValue#
						</CFCASE>
						<!--- calendar lookup --->
						<CFCASE VALUE="ftdatetime">
							<CFIF sEntryValue EQ "01/01/1900">
								&nbsp;
							<CFELSE>
								#DateFormat(sEntryValue,"mmmm d, yyyy")#
							</CFIF>
						</CFCASE>

						<!--- memo fields --->
				    <CFCASE VALUE="ftmemo">
							<TEXTAREA
								ROWS="3"
								STYLE="background-color: transparent; border-bottom: none; border-left: none; border-right: none; border-top: none; font-weight: bold; width: 99%;" readonly>#HTMLEditFormat(sEntryValue)#</TEXTAREA>
						</CFCASE>

						<!--- blob fields --->
				    <CFCASE VALUE="ftblob">
							interface not supported.
						</CFCASE>

						<!--- images (asks for paths) --->
				    <CFCASE VALUE="ftgraphic">
							interface not supported.
						</CFCASE>

						<CFDEFAULTCASE>

							<!--- there's a lookup --->
							<CFQUERY NAME="GetLookup" DATASOURCE="#client.global_dsn#">
									SELECT A.*, B.LEVELID
									FROM GSTLOOKUP A, GRGBOSETABLE B
									WHERE
										(A.MASTERTABLE = '#GetForm.TABLENAME_FK#') AND
										(A.MASTERFIELD = '#COLUMNNAME#') AND
										(A.LOOKUPTABLE = B.TABLENAME)
							</CFQUERY>
							<CFIF GetLookup.RecordCount>
								<CFIF (#trim(GetLookup.LEVELID)# IS "") OR
											(#trim(GetLookup.LOOKUPKEYFIELD)# IS "") OR
											(#trim(GetLookup.LOOKUPRESULTFIELD)# IS "") OR
											(#trim(GetLookup.LOOKUPTABLE)# IS "")>
									<I>*Lookup not properly setup.</I>
								<CFELSE>
									<!--- get the description in the lookup --->
									<CFIF len(trim(sEntryValue)) NEQ 0>
										<CFMODULE TEMPLATE="#client.common_path#cfm_leveldsn.cfm" DBLEVEL="#GetLookup.LEVELID#">
										<CFSET lk_dsn = DSN>

										<CFQUERY NAME="GetLkDesc" DATASOURCE="#lk_dsn#">
											SELECT #GetLookup.LOOKUPRESULTFIELD#
											<!--- For extra lookup description --->
											<CFIF Trim(GetLookup.EXTRARESULTFLD) NEQ "">
												,#GetLookup.EXTRARESULTFLD#
												<CFSET lWithExtra=true>
											</CFIF>
											FROM #GetLookup.LOOKUPTABLE#
											WHERE
												(#GetLookup.LOOKUPKEYFIELD# = '#sEntryValue#')
										</CFQUERY>

										<CFIF GetLkDesc.RecordCount>
											[#sEntryValue#] #evaluate("GetLkDesc." & GetLookup.LOOKUPRESULTFIELD)#
										<CFELSE>
											[value not found in the lookup.]
										</CFIF>

										<!--- for chart --->
										<CFIF LCase(ISORGCHART) IS "y">
											&nbsp;&nbsp;<A HREF="javascript:ShowChart('#Trim(GetLookup.LEVELID)#','#Trim(GetLookup.LOOKUPTABLE)#','#Trim(GetLookup.LOOKUPKEYFIELD)#','#Trim(GetLookup.LOOKUPRESULTFIELD)#','#sEntryValue#', '', '#COLUMNDESC#')">show chart</A>
										</CFIF>
									</CFIF>
								</CFIF>	<!--- getlookup.recordcount --->
							<CFELSE>
								<!--- standard edit --->
								#HTMLEditFormat(sEntryValue)#
							</CFIF>

						</CFDEFAULTCASE>
					</CFSWITCH>
					</B>
					</TD>
				</TR>

				<CFIF lWithExtra>
					<!--- Get the description and datatype of display fields for lookup --->
					<CFSET sComma="">
					<CFQUERY NAME="qryDispLkUp" DATASOURCE=#client.global_dsn#>
						SELECT COLUMNNAME, COLUMNDESC, COLUMNTYPE
						FROM GRGBOSETABLEFIELDS
						WHERE (TABLENAME = '#Trim(GetLookup.LOOKUPTABLE)#') AND
							  (
							  	COLUMNNAME IN (
						  	<CFLOOP LIST="#GetLookup.EXTRARESULTFLD#" INDEX="x">
								#sComma# '#Trim(x)#'
								<CFSET sComma=",">
							</CFLOOP>
							  )
							  )
					</CFQUERY>
					<CFSET lstKeyValue=Valuelist(qryDispLkUp.COLUMNNAME)>

					<CFLOOP LIST="#GetLookup.EXTRARESULTFLD#" INDEX="x">
						<CFSET x = trim(x)>
						<TR VALIGN="top">

							<CFSET nPos=ListFindNocase(#lstKeyValue#, #x#)>
							<CFIF nPos NEQ 0>
								<CFSET sColDesc=#qryDispLkUp.COLUMNDESC[nPos]#>
								<CFSET sDataType=#qryDispLkUp.COLUMNTYPE[nPos]#>
							<CFELSE>
								<CFSET sColDesc="">
								<CFSET sDataType="">
							</CFIF>

							<TD NOWRAP VALIGN="top" ALIGN="right">#sColDesc#:</TD>
							<TD VALIGN="top" WIDTH="100%" HEIGHT=18 nowrap>&nbsp;<B>
								<!--- check on what form control to use --->
								<CFIF LCase(sDataType) IS "ftmemo">
									<TEXTAREA ROWS="3" STYLE="background-color: transparent; border-bottom: none; border-left: none; border-right: none; border-top: none; font-weight: bold; width: 99%;">#HTMLEditFormat(evaluate("GetLkDesc." & Trim(x)))#</TEXTAREA>
								<CFELSEIF LCase(sDataType) IS "ftdatetime">
									#DateFormat(evaluate("GetLkDesc." & Trim(x)), "mmmm d, yyyy")#
								<CFELSE>
									#HTMLEditFormat(evaluate("GetLkDesc." & Trim(x)))#
								</CFIF>
							</TD>
						</TR>
					</CFLOOP>
				</CFIF>
			</CFIF>

			</CFOUTPUT>
		</CFOUTPUT>
		</TABLE>
		<BR>
		Note: Fields with null values are automatically excluded in the view function.
		<BR><BR>
		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
	</CFIF>

